package cn.apestar.modules.sys.component;

import java.util.ArrayList;
import java.util.List;
import cn.apestar.common.utils.tran.TransLateCondition;
import cn.apestar.common.utils.tran.TranslateUtil;
import cn.apestar.modules.sys.entity.User;

/**
 * 人员翻译
 * 
 * @author lvh
 */
public class UserTranslate {

    // 初始化翻译数据
    public static List initTranslate() {
        List list = new ArrayList();
        return list;
    }

    /**
     * 翻译单个人员
     */
    public static User translateUser(User u) {
        List listHTranslate = initTranslate();
        for (int i = 0; i < listHTranslate.size(); i++) {
            TransLateCondition t = (TransLateCondition) listHTranslate.get(i);
            TranslateUtil.t.translateListT(u, t, false);
        }
        return u;
    }

    /**
     * 翻译人员集合
     */
    public static List<User> translateListUser(List<User> list) {
        List listHTranslate = initTranslate();
        for (int i = 0; i < listHTranslate.size(); i++) {
            TransLateCondition t = (TransLateCondition) listHTranslate.get(i);
            TranslateUtil.t.translateList(list, t, false);
        }
        return list;
    }
}
